﻿@model IEnumerable<vngoodlife.Member>

@{
    ViewBag.Title = "AdminList";
}

<!-- Begin one column tab content window -->
    <div class="onecolumn">
        <div class="header">
            <span>Danh Sách Admin</span>
            <div class="switchbutton">
                <a href="@Url.Action("CreateAdmin", "Admin")" class="button">Thêm mới</a>
            </div>
        </div>
        <br class="clear" />
        <div class="content">
            <div id="tab1_content" class="tab_content">
                <table width="100%">
                    <tr>
                        <td>
                            <div id="tablewrapper">
                                <div id="tableheader">
                                    <div class="search">
                                        <select id="columns" onchange="sorter.search('query')">
                                        </select>
                                        <input type="text" id="query" onkeyup="sorter.search('query')" style="width:170px;" />
                                    </div>
                                    <div class="details">
@*                                        <div class="ddl">
                                            <div>
                                            <label>Loại Comment:</label>
                                                @using (Html.BeginForm("CommentList_BackEnd", "Comment", new { amountOfComment = ViewBag.AmountOfComment }, FormMethod.Post, null))
                                                {
                                                    @Html.AntiForgeryToken(vngoodlife.Util.AntiKey.EditSalt)
                                                    @Html.DropDownList("CommentTypeID", (SelectList)ViewBag.CommentType, new { style = "width: 150px;", onchange = "this.form.submit();" })
                                                } 
                                            </div>
                                        </div>*@
                                        <div>
                                            Kết quả
                                            <span id="startrecord"></span>-<span id="endrecord"></span>
                                            của
                                            <span id="totalrecords"></span>
                                        </div>
                                        <div><a href="javascript:sorter.reset()">Thiết lập lại</a></div>
                                    </div>
                                </div>
                                <table cellpadding="0" cellspacing="0" border="0" id="table" class="tinytable">
                                    <thead>
                                        <tr>
                                           <th><h3>Tên đăng nhập</h3></th>
                                           <th><h3>Quyền</h3></th>
                                           <th><h3>Họ và tên</h3></th>
                                            <th><h3>Giới tính</h3></th>
                                            <th><h3>Email</h3></th>
                                            <th><h3>Hiện/Ẩn</h3></th>
                                            <th><h3>Đăng nhập</h3></th>
                                            <th><h3>Đăng xuất</h3></th>
                                            <th class="nosort"><h3>Chỉnh sửa</h3></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        @foreach (var item in Model)
                                        { 
                                        <tr>
                                            <td style="width: 140px; text-align: center;">
                                                @item.MemberName
                                            </td>
                                            <td style="width: 100px; text-align: center;">
                                                @item.MemberRole.RoleName
                                            </td>
                                            <td  style="width: 250px; text-align: center;">
                                                @item.FullName
                                            </td>

                                            <td style="width: 80px; text-align: center;">
                                                @item.Gender.GenderName
                                            </td>
                                            <td style="width: 200px; text-align: center;">
                                                @item.Email
                                            </td>
                                            <td style="width: 80px; text-align: center;">
                                                @(item.IsActive == true ? "Hiện" : "Ẩn")
                                            </td>
                                            <td style="width: 130px; text-align: center;">
                                                @(vngoodlife.Util.GeneralClass.ConvertDate_1B(item.LastLogin))
                                            </td>
                                            <td  style="width: 130px; text-align: center;">
                                                @(vngoodlife.Util.GeneralClass.ConvertDate_1B(item.LastLogout))
                                            </td>
                                            <td style="width: 60px;text-align: center">
                                                <a href="@Url.Action("AdminEdit", "Admin", new { memberName = item.MemberName })"><span class="grid-edit"></span></a>
                                            </td>
                                        </tr>
                                         } 
                                    </tbody>
                                </table>
                                <div id="tablefooter">
                                    <div id="tablenav">
                                        <div>
                                            <img alt="" src="../../../Content/table/images/first.gif" />
                                            <img src="../../../Content/table/images/first.gif" width="16" height="16" alt="First Page"
                                                onclick="sorter.move(-1,true)" />
                                            <img src="../../../Content/table/images/previous.gif" width="16" height="16" alt="First Page"
                                                onclick="sorter.move(-1)" />
                                            <img src="../../../Content/table/images/next.gif" width="16" height="16" alt="First Page" onclick="sorter.move(1)" />
                                            <img src="../../../Content/table/images/last.gif" width="16" height="16" alt="Last Page" onclick="sorter.move(1,true)" />
                                        </div>
                                        <div>
                                            <select id="pagedropdown"></select>
                                        </div>
                                        <div>
                                            <a href="javascript:sorter.showall()">Xem tất cả</a>
                                        </div>
                                    </div>
                                    <div id="tablelocation">
                                        <div>
                                            <select onchange="sorter.size(this.value)">
                                                <option value="5" >5</option>
                                                <option value="20">20</option>
                                                <option value="50" selected="selected">50</option>
                                                <option value="100" >100</option>
                                                <option value="200">200</option>
                                            </select>
                                            <span>Kết quả mỗi trang</span>
                                        </div>
                                        <div class="page">
                                            Trang
                                            <span id="currentpage"></span>
                                            của
                                            <span id="totalpages"></span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <script type="text/javascript" src="../../../Content/table/1.js"></script>
                            <script type="text/javascript">
                                var sorter = new TINY.table.sorter('sorter', 'table', {
                                    headclass: 'head',
                                    ascclass: 'asc',
                                    descclass: 'desc',
                                    evenclass: 'evenrow',
                                    oddclass: 'oddrow',
                                    evenselclass: 'evenselected',
                                    oddselclass: 'oddselected',
                                    paginate: true,
                                    size: 50,               /*Number of rows show when running in first times */
                                    colddid: 'columns',
                                    currentid: 'currentpage',
                                    totalid: 'totalpages',
                                    startingrecid: 'startrecord',
                                    endingrecid: 'endrecord',
                                    totalrecid: 'totalrecords',
                                    hoverid: 'selectedrow',
                                    pageddid: 'pagedropdown',
                                    navid: 'tablenav',
                                    /*
                                    sortcolumn: 0,
                                    sortdir: 1,
                                    sum:[8],
                                    avg:[6,7,8,9],
                                    columns:[{index:7, format:'%', decimals:1},{index:8, format:'$', decimals:0}], */
                                    init: true
                                });
                            </script>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
<!-- End one column tab content window -->
